﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LevelEditor
{
    public partial class ScreenSettings : Form
    {
        private LevelEditor editor;

        public ScreenSettings(LevelEditor editor,int screenW,int screenH)
        {
            this.editor = editor;
            InitializeComponent();
            screenWidth.Text = screenW + "";
            screenHeight.Text = screenH + "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (!screenWidth.Text.Equals(""))
            {
                editor.MAP_WIDTH = (int) Convert.ToDouble(screenWidth.Text);
                editor.MAP_HEIGHT = (int)Convert.ToDouble(screenHeight.Text);
                editor.pictureBox1.Width = editor.MAP_WIDTH;
                editor.pictureBox1.Height = editor.MAP_HEIGHT;
                editor.pictureBox1.Invalidate();
                this.Dispose();
            }
        }
    }
}
